The present invention relates to a sound generating apparatus, and more particularly to a digital sound generating apparatus and sound generating method therefor which is capable of improving availability of a central processing unit (CPU) and improving performance effects by assigning the most appropriate slot through a slot assigner rather than the CPU and providing information on slot assignment to the CPU.
A conventional sound generating apparatus includes, as shown in FIG. 1, a slot memory 2 for storing various sound control parameters, a CPU interface 1 for exchanging information with the slot memory 2 and a CPU, a data processor 3 for executing an operation to reproduce an original sound using the various control parameters of the slot memory 2, and a volume controller 4 for receiving the information of the slot memory 2 and the data processor 3 to control the volume of the original sound.
In a general digital sound processor, a volume envelope indicating temporal variations in the volume has ADSR (attack, decay, sustain and release) forms. For example, when a key on a musical keyboard is turned On by pressing it, the conventional sound generating apparatus of FIG. 1 continues to generate a sound at a sustain level S after passing through an attack level A and a decay level D, as shown in FIG. 2A. Once the key is OFF, the sound is attenuated at a release level R according to a release value. In another case, when the key is ON, the sound is gradually attenuated with the lapse of time, as shown in FIG. 2B.
In operation, if a message indicating that the key is an ON state is received, the CPU writes in the slot memory 2 a start volume level (1), a final volume level (2), and a temporal volume variation between the start and final volume levels, i.e. a volume rate as shown in FIGS 2A and 2B, in order to achieve the desired attack interval A. The volume rate of an interval (1)-(2)' is larger than that of (1)-(2), and the interval (2)'-(3) is smaller than that of (2)-(3).
The volume rate has a positive number only at a start (or attack) interval and has a negative number or a zero value at other intervals. Although information related to the written start volume is not shown in the drawings, the volume rate is added to a current volume of every frame by an envelope generator and the current volume continues to increase until it reaches a target volume level.
If the current volume level reaches the target volume level, the attack interval is completed, and the current volume level is as indicated by (2). Then, the CPU writes a new target volume level (3) and a new volume rate in the slot memory 2 in the same way as in the attack operation. Similar operations are carried out for the sustain and release intervals.
When various sounds are generated at the same time, in particular, when all slots which are capable of generating a sound generate sounds simultaneously, if a new sound to be performed is received, the CPU searches for a slot having the lowest volume level by comparing volume information of all the slots and then inserts a parameter for the new sound in that slot. Assuming that the number of sounds which is capable of being simultaneously processed is 32 and a sampling rate is 44.1 KHz, 32 sounds are sequentially processed during one frame of 22.6 .mu.s, as shown in FIG. 4. Each sound is processed in the unit of a slot and parameters for processing each sound are written in the slot memory by the CPU. The information written in the slot memory to generate one sound, includes a sample address which is an address of a sound sample memory for storing a sound to be performed in a corresponding slot, pitch control for designating the amplitude of a sound, filter control for adjusting timbre, volume control for controlling a temporal variation in the volume, and the like, as shown in FIG. 3. During one frame shown in FIG. 4, slots from slot (0) to slot (31) are sequentially processed.
If it is desired to simultaneously process an A instrument sound at a first slot, a B instrument sound at a second slot and a C instrument sound at a third slot, parameters of the A, B and C instrument sounds are sequentially written in slot (0), slot (1) and slot (2) parameter areas, respectively, through the CPU interface 1. A slot operation mask bit (SOMB) is set to 1 in slot (3) to the last slot parameter area so that no information is written in those slots.
If the parameters for all the slots are received, the data processor 3 and the volume controller 4 shown in FIG. 1 reproduce an original sound from the first slot. The reproduced sound is stored in an internal accumulator (not shown) of the volume controller 4. Thereafter, the second and third slots are sequentially processed and their sounds are sequentially added to the sound stored in the accumulator. Since other slots are not operated, there are no further changes in the accumulator.
If one frame is all processed, data in the accumulator is transmitted to a speaker through a digital-to-analog converter. Since the data processed during one frame is one sampling data out of a number of sampling data of a sound sampled at a constant time interval, a plurality of frames corresponding to the number of sampling data of a corresponding sound should be processed in order to completely process one sound. Further, since each sound differs in length and amplitude, the above A, B and C sounds are completed late if the sampling data is long if the sound is and strong. If 32 sounds are to be simultaneously made, an accurate decision should be made as to what sound should be completed first. If it is necessary to perform a new sound under the state that 32 sounds are not completed, a parameter for the new sound should be inserted in the least important slot in a sound to prevent unnatural performance.
However, since the above sound generating apparatus considers only the volume level received in each slot or only processes the first performance start slot, an important sound to be performed may be wrongly processes, which leads to deterioration in performance effects. Furthermore, since the CPU should take part in volume control information processing of each slot memory whenever a slot is assigned, the processing speed of the sound generating apparatus is delayed when there are many sounds to be generated. To improve this disadvantage, a CPU with a faster processing speed maybe used, but such products are expensive.